package com.hongdee.insurance.order.service;

import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.util.List;
import java.util.Map;

/**
 * @author 王帅
 * @className ITInsuranceOrderStatsticsService
 * @type
 * @description
 * @path com.hongdee.insurance.order.service
 * @create 2017/7/3 10:08
 **/
public interface ITInsuranceOrderStatsticsService {

    /**
     * 根据公司新增保险单到统计信息表
     * @param companyId
     */
    public void addOrderToStatistics(String companyId,String orderId) throws Exception;

    /**
     * 当保单更新后，将更新后的信息更新至统计信息表
     * @param orderId
     * @param companyId
     */
    public void updOrderToStatistics(String orderId, String companyId) throws Exception;

    public void updOrderToStatistics(String companyId) throws Exception;

    /**
     * 当天或当周报表统计
     * @param uid
     * @param type
     * @param time
     * @param brand 品牌
     * @param companyId 4s店
     * @param dict 区域
     * @param start
     * @param limit
     * @return
     * @throws Exception
     */
    public Map<String,Object> dayAndWeek(String uid, String type, String time, String brand, String companyId, String dict, String start, String limit) throws Exception;

    /**
     * 当天或当周报表导出Excel
     * @param uid
     * @param type
     * @param time
     * @param brand
     * @param companyId
     * @param dict
     * @return
     * @throws Exception
     */
    public XSSFWorkbook dayAndWeekExpExcel(String uid, String type, String time, String brand, String companyId, String dict) throws Exception;
    /**
     * 当周保费分配
     * @param uid
     * @param time
     * @param companyId
     * @param insuranceType
     * @param dict
     * @param brand
     * @param start
     * @param limit
     * @return
     * @throws Exception
     */
    public Map<String,Object> weekInsurancePage(String uid, String time, String companyId, String insuranceType, String dict, String brand,
                                                String start, String limit) throws Exception;

    /**
     * 当周保费分配导出excel
     * @param uid
     * @param time
     * @param companyId
     * @param insuranceType
     * @param dict
     * @param brand
     * @return
     * @throws Exception
     */
    public XSSFWorkbook weekAndMonthInsuranceExpExcel(String uid, String time, String companyId, String insuranceType, String dict,
                                                      String brand, String type) throws Exception;

    /**
     * 当月保费分配
     * @param uid
     * @param time
     * @param companyId
     * @param insuranceType
     * @param dict
     * @param brand
     * @param start
     * @param limit
     * @return
     * @throws Exception
     */
    public Map<String,Object> monthInsurancePage(String uid, String time, String companyId, String insuranceType, String dict, String brand,
                                                 String start, String limit) throws Exception;

    /**
     * 月度统计报表
     * @param uid
     * @param companyid
     * @param time
     * @param brand
     * @param dict
     * @param start
     * @param limit
     * @return
     * @throws Exception
     */
    public Map monthInsuranceStatics(String uid, String companyid, String time, String brand, String dict, String start, String limit) throws Exception;

    /**
     * 保险返利台账查询
     * @param uid
     * @param start
     * @param limit
     * @param time
     * @return
     * @throws Exception
     */
    public Map insruanceRebatPage(String uid, String start, String limit, String time,String companyId) throws Exception;

    /**
     * 保险返利台账导出Excel
     * @param uid
     * @param time
     * @return
     * @throws Exception
     */
    public XSSFWorkbook insruanceRebatExpExcel(String uid, String time,String companyId) throws Exception;

    /**
     * 返利台账导出Excel
     * @param uid
     * @param time
     * @return
     * @throws Exception
     */
    public XSSFWorkbook monthInsuranceStaticsExpExcel(String uid, String companyid, String time, String brand, String dict) throws Exception;


    /**
     * 送修比财务占比
     * @param uid
     * @param time
     * @param start
     * @param limit
     * @return
     * @throws Exception
     */
    public Map insuranceRepairPage(String uid, String time,String companyId, String start, String limit) throws Exception;

    /**
     * 统计保险销售信息
     * @param time
     * @param insuranceType
     * @param uid
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> insuranceSales(String companyId,String time, String insuranceType, String uid) throws Exception;


    /**
     * 保险月报表
     * @param companyId
     * @param date
     * @param insureType
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> monthStatics(String companyId,String date,String insureType) throws Exception;


    /**
     * 保险OA台账
     * 1、先查询正常及追加保单，生成基本的数据信息
     * 2、查询退保信息，退保需要关联原保单信息；
     * 3、设置导出Excel表头；
     * 4、填充数据；
     * @param uid
     * @param data
     */
    public XSSFWorkbook expInsuranceOrderToExcel(String uid, Map<String,Object> data,String type,String newPath,String fileId) throws Exception;

    /**
     * 导出续保OA台账
     * @param uid
     * @param data
     * @param newPath
     * @param fileId
     * @return
     * @throws Exception
     */
    public XSSFWorkbook insuranceAccountExpExcel(String uid,Map<String,Object> data,String newPath,String fileId) throws Exception;

    /**
     * 保险返利台账报表
     * @param uid
     * @param companyId
     * @param date
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> statsticsMonthRebate(String uid,String companyId,String date) throws Exception;
}
